Reference cache maintenance optimizer

ABSTRACT

Processors configured by aspects of the present invention optimize reference cache maintenance in a serialization system by serializing a plurality of objects into a buffer and determining whether any of the objects are repeated within the buffered serialized plurality. The configured processors insert an object repetition data signal within the serialized plurality of objects that indicates to a receiver whether or not any objects are determined to be repeated within the buffered serialized plurality of objects, and send the serialized plurality of objects with the inserted object repetition data signal as a single chunk to a receiver, wherein the inserted object repetition data signal conveys reference cache management instructions to the receiver.

BACKGROUND

A typical enterprise Java™ application may include a server servicing alot of clients. (JAVA and all JAVA-based trademarks and logos aretrademarks or registered trademarks of Oracle and/or its affiliates.) Ina banking application example hundreds of customers connect to a servervia client applications (“clients”) to effect transactions on theiraccount (make a balance enquiry, a withdrawal, etc.). Such transactionsare actually a remote call to the server and require data to beexchanged between the client and server.

Distributed computing in JAVA makes use of Remote Method Invocation(RMI)-Java Remote Method Protocol (JRMP) and RMI-Internet Inter-ORBProtocol (IIOP) technologies, wherein “ORB” refers to an Object RequestBroker.

JRMP is a JAVA-specific, stream based protocol for JAVA-to-JAVA remotecalls, requiring both clients and server to use JAVA objects. RMI-IIOPdenotes the JAVA RMI interface over the IIOP, which delivers CommonObject Request Broker Architecture (CORBA) distributed computingcapabilities to the JAVA platform. With features inherited from CORBA,software components that work together can be written in differentlanguages (for example, C++ and JAVA).

Both RMI-JRMP and RMI-IIOP leverage JAVA serialization to communicate(transfer parameters) between components. Marshaling involvesserialization and is a process of decomposing an instantiated objectinto a data format that may be transferred via a message. Un-marshalingis a process of reconstructing an instantiated object at a receivingdevice in response to receipt of a message, including an objectformatted as serialized/marshaled data.

BRIEF SUMMARY

In one aspect of the present invention, a computerized method foroptimizing reference cache maintenance in a serialization systemincludes executing steps on a computer processor. Thus, a computerprocessor configured by an aspect of the present invention serializes aplurality of objects into a buffer and determines whether any of theobjects are repeated within the buffered serialized plurality. Theconfigured processor inserts an object repetition data signal within theserialized plurality of objects that indicates to a receiver whether ornot any objects are determined to be repeated within the bufferedserialized plurality of objects, and sends the serialized plurality ofobjects with the inserted object repetition data signal as a singlechunk to a receiver, wherein the inserted object repetition data signalconveys reference cache management instructions to the receiver.

In another aspect, a system has a hardware processor in circuitcommunication with a computer readable memory and a computer-readablestorage medium having program instructions stored thereon. The processorexecutes the program instructions stored on the computer-readablestorage medium via the computer readable memory and is therebyconfigured by an aspect of the present invention to serialize aplurality of objects into a buffer and to determine whether any of theobjects are repeated within the buffered serialized plurality. Theconfigured processor inserts an object repetition data signal within theserialized plurality of objects that indicates to a receiver whether ornot any objects are determined to be repeated within the bufferedserialized plurality of objects, and sends the serialized plurality ofobjects with the inserted object repetition data signal as a singlechunk to a receiver, wherein the inserted object repetition data signalconveys reference cache management instructions to the receiver.

In another aspect, a computer program product for optimizing referencecache maintenance in a serialization system has a computer-readablestorage medium with computer readable program code embodied therewith.The computer readable hardware medium is not a transitory signal per se.The computer readable program code includes instructions for executionwhich cause the processor to serialize a plurality of objects into abuffer and determine whether any of the objects are repeated within thebuffered serialized plurality. The processor is further therebyconfigured to insert an object repetition data signal within theserialized plurality of objects that indicates to a receiver whether ornot any objects are determined to be repeated within the bufferedserialized plurality of objects, and send the serialized plurality ofobjects with the inserted object repetition data signal as a singlechunk to a receiver, wherein the inserted object repetition data signalconveys reference cache management instructions to the receiver.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other features of embodiments of the present invention will bemore readily understood from the following detailed description of thevarious aspects of the invention taken in conjunction with theaccompanying drawings in which:

FIG. 1 depicts a cloud computing environment according to an embodimentof the present invention.

FIG. 2 depicts a cloud computing node according to an embodiment of thepresent invention.

FIG. 3 is a schematic illustration of a programmable device according toan aspect of the present invention.

FIG. 4 is a flow chart illustration of a serialization system accordingto an embodiment of the present invention.

DETAILED DESCRIPTION

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

It is understood in advance that although this disclosure includes adetailed description on cloud computing, implementation of the teachingsrecited herein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g. networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure comprising anetwork of interconnected nodes.

Referring now to FIG. 1, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 comprises one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 1 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 2, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 1) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 2 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include: mainframes 61; RISC(Reduced Instruction Set Computer) architecture based servers 62;servers 63; blade servers 64; storage devices 65; and networks andnetworking components 66. In some embodiments, software componentsinclude network application server software 67 and database software 68.

Virtualization layer 70 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers71; virtual storage 72; virtual networks 73, including virtual privatenetworks; virtual applications and operating systems 74; and virtualclients 75.

In one example, management layer 80 may provide the functions describedbelow. Resource provisioning 81 provides dynamic procurement ofcomputing resources and other resources that are utilized to performtasks within the cloud computing environment. Metering and Pricing 82provide cost tracking as resources are utilized within the cloudcomputing environment, and billing or invoicing for consumption of theseresources. In one example, these resources may comprise applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal 83 provides access to the cloud computing environment forconsumers and system administrators. Service level management 84provides cloud computing resource allocation and management such thatrequired service levels are met. Service Level Agreement (SLA) planningand fulfillment 85 provide pre-arrangement for, and procurement of,cloud computing resources for which a future requirement is anticipatedin accordance with an SLA.

Workloads layer 90 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation 91; software development and lifecycle management 92; virtualclassroom education delivery 93; data analytics processing 94;transaction processing 95; and processing 96 for optimizing referencecache maintenance in a serialization system according to embodiments ofthe present invention, for example to execute the process steps orsystem components or tasks as depicted in FIG. 4 below.

FIG. 3 is a schematic of an example of a programmable deviceimplementation 10 according to an aspect of the present invention, whichmay function as a cloud computing node within the cloud computingenvironment of FIG. 2. Programmable device implementation 10 is only oneexample of a suitable implementation and is not intended to suggest anylimitation as to the scope of use or functionality of embodiments of theinvention described herein. Regardless, programmable deviceimplementation 10 is capable of being implemented and/or performing anyof the functionality set forth hereinabove.

A computer system/server 12 is operational with numerous other generalpurpose or special purpose computing system environments orconfigurations. Examples of well-known computing systems, environments,and/or configurations that may be suitable for use with computersystem/server 12 include, but are not limited to, personal computersystems, server computer systems, thin clients, thick clients, hand-heldor laptop devices, multiprocessor systems, microprocessor-based systems,set top boxes, programmable consumer electronics, network PCs,minicomputer systems, mainframe computer systems, and distributed cloudcomputing environments that include any of the above systems or devices,and the like.

Computer system/server 12 may be described in the general context ofcomputer system-executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

The computer system/server 12 is shown in the form of a general-purposecomputing device. The components of computer system/server 12 mayinclude, but are not limited to, one or more processors or processingunits 16, a system memory 28, and a bus 18 that couples various systemcomponents including system memory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnects (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via Input/Output(I/O) interfaces 22. Still yet, computer system/server 12 cancommunicate with one or more networks such as a local area network(LAN), a general wide area network (WAN), and/or a public network (e.g.,the Internet) via network adapter 20. As depicted, network adapter 20communicates with the other components of computer system/server 12 viabus 18. It should be understood that although not shown, other hardwareand/or software components could be used in conjunction with computersystem/server 12. Examples, include, but are not limited to: microcode,device drivers, redundant processing units, external disk drive arrays,RAID systems, tape drives, and data archival storage systems, etc.

Serialization plays an important role in the performance of adistributed cluster application, for example in an Apache Spark™ system,to persist Resilient Distributed Dataset (RDD) in memory, and tocommunicate task and staging related information between master andslave. (APACHE SPARK, SPARK and the SPARK logo are trademarks of theApache Software Foundation (ASF) in the United States or othercountries). Accordingly, it is desirable to optimize bottlenecks presentin serialization frameworks to improve the performance of an overallapplication.

Serialization frameworks generally maintain a reference cache (forexample, a handle table, a value cache, etc.) to replicate a same objectgraphed from a sender to a receiver. For example, consider the followingobject example (1):

public class SerializationExample implements java.io.Serializable {private String field1 = “Hello”; private String field2 = field1; }

Both members of class “SerializationExample” point to the same stringobject “Hello.” In order to replicate the same graph to the other side,a computer system processor that is configured to provide aserialization framework (hereinafter sometimes the “serializationframework processor”) caches the objects (top level object and itsfields) into a reference cache when it is about to be serialized. Laterif the serialization framework processor finds that the same object ispresent in the table (in this case “field2”), it sends a special markerto a computer system processor that is configured to provide receiverfunctions (the “receiver”) so that the receiver can point to same objectand replicate the exact graph. The following is an example of a simplemarshalling flow by the serialization framework processor that isassociated with a reference cache:

(a) In response to input of the “SerializationExample” object forserialization, the serialization framework processor looks into thereference cache to see if it is already marshalled. (Since it is thefirst time this object is given for serialization in the presentexample, it is not present in the cache.)

(b) In response to determining that it is not already marshalled, theserialization framework processor adds the “SerializationExample” objectinto the reference cache and assigns a unique number, for example “0.”

(c) Subsequently, in response to an input of “field1” of theSerializationExample for serialization, the serialization frameworkprocessor performs a look-up in the reference cache for the stringobject “Hello” that is pointed to by the “field1” input. In response todetermining that said string object “Hello” is not present in thereference cache, the serialization framework processor adds the stringobject “Hello” into the reference cache.

(d) Subsequently, in response to an input of “field2” for serialization,the serialization framework processor searches for and thereby find theentry in the reference cache added in step (c) above. In response,instead of marshalling the string object “Hello,” the serializationframework processor sends a special marker to the receiver, so that thereceiver can point to the object referenced (pointed to) by “field1.”

The serialization framework processor associates a handle value “0” withthe “SerializationExample” object, and a handle value “1” with thestring object “Hello,” within the reference cache. The following is aserialized form byte array (ORB) of the object example (1) describedabove, “RRMI:SerializationExample:A7EA 5821F9B8CF6p.Hellop.Hi”:

0000: 7252524d 493a5365 7269616c 697a6174

0010: 696f6e45 78616d70 6c653a41 37454132

0020: 35383231 46394238 43463670 0 a72656c

0030: 6c6fff01

The first byte “0x72” indicates that the serialized form represents anobject, which is then followed by a repository identification (ID) instring format. The repository ID is formed by writing the name of theclass followed by the Stream Unique Identifier (SUID) orserialVersionUID. A receiver uses the repository ID (especially theclass name) to determine a type present in the serialized byte array.The receiver writes the repository ID of the top level object, startingwith the fields present in the object (“field1”), then the value tag(“0x72”), then the content of the string “Hello”. When the receiverencounters the next field (“field2”), it finds that the string objectpointed to by “field2” is already serialized, and in response writes aspecial value tag “0xFF” indicated by the underlining emphasis above(wherein “FF” is a hexadecimal number which has an integer value of255), followed by a handle associated with the object.

When the receiver side de-serializes the serialized form representingthe object it encounters a value tag or special tag, and in responsebuilds a similar reference cache (comprising the same handle valueassociations (“0” associated with the “SerializationExample” object, and“1” associated with the string object “Hello”) but in reverse orderrelative to the reference cache of the sender, the serializationframework processor), and accordingly when it encounters the special tag“0xFF” it look into the reference cache to find the original object. Thereference caches are maintained at both sender and receiver sides,wherein both need to cache all encountered unique objects; the referencecaches are also maintained per stream.

Though costs may be saved by serializing a repeated object (such as the“field2” “Hello” in the above example), maintaining a reference cachegeneral requires significant overhead expenditures. For example, wherean application server sends 27,000 records (with each record containing17 reference fields) from a database to a web server, the sender andreceiver each need to maintain a reference cache of about 3.5 MB (forabout 459,000 references on a 64-bit platform), and also servicemultiple calls to resize the cache, without any one object beingreferenced twice.

Aspects of the present invention provide efficiencies over the prior artby reducing memory usage and the cost of reference cache maintenance atthe receiver side, and providing overall throughput improvement, as afunction of feedback and learning from sender.

FIG. 4 illustrates a process or system according to the presentinvention for optimizing reference cache maintenance in a serializationsystem. At 102 a processor that is configured to provide a serializationframework according to the present invention (the serializationframework processor) serializes a plurality of objects (messages) into abuffer, wherein the serialization includes determining at 104 whetherany objects are repeated within the buffered serialized plurality ofobjects.

At 106 the serialization framework processor inserts an objectrepetition data signal within the serialized plurality of objects thatindicates the result of the determination at 104 (whether or not anyobjects are repeated within the buffered serialized plurality ofobjects). Examples of inserting an object repetition data signal at 106include the following three schemas:

Schema (i): inserting an extra byte of information before a start of afirst top level object that indicates whether a current object graph ina reference cache generated by the serializing the plurality of objectsinto the buffer has a repeated object or not;

Schema (ii): inserting, immediately after an extra byte of informationinserted according to schema (i) (before the start of the first toplevel object) that indicates the serialized plurality of objects has arepeated object, secondary bytes of information that comprise a list ofhandles of the objects that are repeated in the serialized plurality ofobjects; and

Schema (iii) inserting a special value tag encoding an object determinedto be repeated within the serialized plurality of objects, at a locationof the repeated objected within the serialized plurality of objects.

At 108 the serialization framework processor sends the serializedplurality of objects with the inserted object repetition data signal asa single chunk to another processor configured to act as a receiver,wherein the inserted object repetition data signal conveys referencecache management instructions to the receiver.

In ORB messages are first serialized into a local buffer (a byte arraymaintained in an ORB layer) and then transferred to the remote server inone chunk or multiple chunks based on user preferences. Buffering allmarshalled data in one chunk and transferring to a receiver generallyprovides for better performance relative to sending multiple chunks, andaccordingly aspects of the present invention generally use the one chunkmode.

Thus, according to an aspect of the present invention that appliesschema (i), a serialization framework processor according to the presentinvention inserts an extra byte of information before the start of thefirst top level object and initializes the extra byte value to zero(setting the extra byte value to “0x0”), which signifies to a receiverthere is no repeated object encountered in the object graph (during thedetermination at 104 as to whether any objects are repeated within thebuffered serialized plurality of objects), and therefore that thereceiver doesn't need to maintain the reference cache at all. Otherwise,in response to determining (at 104) that an object is repeated as itserializes the object graph, the serialization framework processorupdates the byte value to “0x01”, which signals to the receiver that anobject is repeated within the serialized plurality of objects.

The serialization framework processor is enabled to determine whetherany object is repeated through its functions in maintaining thereference cache: for example, in response to writing a special tag 0xFFthe serialization framework processor modifies the first byte of theserialized byte array to 0x01, and otherwise it stays at its initializedvalue (0x00). Based on this byte information, the receiver thus eithercreates and maintains a reference cache on the receiver side (inresponse to the value of 0x01), or does not create a receiver sidereference cache at all (in response to the value of 0x00).

For example, the following object example (2) does not have anyrepetitions:

public class SerializationExample implements java.io.Serializable {private String field1 = “Hello”; private String field2 = “Hi”; }

Accordingly, the following first serialized form (SF1) is generated bythe serialization framework processor that uses the (i) extra byte ofinformation schema described above:

0000: 00752524d 493a5365 7269616c 697a61

0010: 74696f6e45 78616d70 6c653a41 374541

0020: 3235383231 46394238 43463670 0a4865

0030: 6c6c6f7004 4869;

wherein the underline first byte value carries the information about therepetition determination: since there is no repetition, it carries thevalue “0x00.” This indicates to the receiver processor that is doesn'tneed to create or maintain the reference cache.

In another aspect of the present invention that uses schema (ii), aserialization framework processor according to the present inventionserializes the object example (1), discussed above:

public class SerializationExample implements java.io.Serializable {private String field1 = “Hello”; private String field2 = field1; }

The present aspect generates the following second serialized form (SF2)from the object example (1):

0000: 01010172 52524d49 3a536572 69616c69

0010: 7a617469 6f6e4578 616d706c 653a4137

0020: 45413235 38323146 39423843 4636700a

0030: 72656c6c 6fff02

As shown above, the underlined first byte of the second serialized form(SF2) carries the information that there are repetitions in the currentserialized graph (“01”), and the next few secondary (underlined) bytescarry the information about the list of handles that are repeated in theserialized object: the number of repetitions (length) in a first subsetof the secondary bytes, followed immediately thereafter by a secondsubset of the secondary bytes that comprises the list of handle valuesof the repeated objects. In this example there is only one objectrepeated, and hence the 2nd byte carries the length (0x01), then theactual handle is carried at the third byte (0x01).

In this case the serialization framework processor as sender creates asmall byte array (repeated handles array) in order to keep datagenerated from the repeated object handles. Whenever an object isdetermined to be repeated, the serialization framework processor writesthe handle of the object (retrieved from the reference cache) onto thisnew byte array. At the end of the process of determining objectrepetition the serialization framework processor flushes (deletes)repeated handles from the handle byte for objects that are repeated morethan once within the serialized content array, before sending out to thereceiver. The first byte carrying the repeated information in the secondserialized form (SF2) is written in the repeated handles byte arrayitself, so that it appears first.

In some aspects, in response to determining a large plurality ofrepetitive object handles (meeting a threshold value), the serializationframework processor replaces the first, extra byte array with apredefined unique data signal value (for example, the byte value “0x02”)at the start of the serialization, to thereby notify the receiver tomaintain the reference cache for all the objects.

In generating the second serialized form (SF2) the serializationframework for the present example the processor builds the referencecache only for one handle in association with the “Hello” object, asthis is the only object that has been determined to be repeated withinsaid serialized form. This provides advantages over the prior art bysaving memory space as well as resize time costs.

The overhead incurred with the second subset bytes (the handle bytearray) is not relatively large. For example, in the case where there are100 repetitions, the handle byte array requires about 900 bytes (about100 bytes of extra memory to carry the repetition information from thesender to receiver, and about 800 bytes to cache those repetitions),compared to about 3.5 MB required under prior art reference cachemaintenance approaches. Also, the maximum size of the array can be set(for example to about 1 KB), wherein if the number of repetitions islarge enough that the handle data cannot be contained within the setmaximum amount (it exceeds this threshold value), the serializationframework processor reverts back to a standard or non-optimized mode,where the receiver will need to maintain all the references in thereference cache.

Another aspect of the present invention uses schema (iii) discussedabove, wherein the inserted object repetition data signal used is aspecial value tag encoding an object determined to be repeated withinthe serialized plurality of objects at the location of the repeatedobjected within the serialized plurality of objects, and thus thereceiver maintains only those references. The present aspect is an ORBexample that uses (0x72) as a value tag to represent a start of anyobject, and (0xFF) to represent a repeated object, which is followed bythe handle of the object. The idea here is to maintain the location ofthe array in which this object is originally serialized along, with thehandle.

Thus, with respect to another object serialization example (3), object“SerializationExample” having a (handle, offset) value of (0,0), andstring object “Hello” repeated therein having a (handle, offset) valueof (1,44), the serialization framework processor utilizing schema (iii)generates the following third serialized form (SF3) after writing“field1” and before writing “field2”:

0000: 01725252 4d493a53 65726961 6c697a61

0010: 74696f6e 4578616d 706c653a 41374541

0020: 32353832 31463942 38434636 720a4865

0030: 6c6c6f;

wherein the start of “field1” (“Hello”) is the underlined value “72” atlocation “44”.

Said serialization framework processor utilizing schema (iii) generatesthe following fourth serialized form (SF4) after writing “field2”:

0000: 01725252 4d493a53 65726961 6c697a61

0010: 74696f6e 4578616d 706c653a 41374541

0020: 32353832 31463942 38434636 EE0a4865

0030: 6c6c6f;

wherein the value at location 44 is modified to “0xEE” to convey to thereceiver that this object is repeated later. This improves efficiencyfor the receiver, which may add those objects in the reference cache forwhich the special tag “0XEE” appears in the serialization buffer, andhence reduce memory and reduce reference cache costs.

Though the schema (iii) approach adds overhead at the sender side (tocache the array location of each object), it reduces the overhead at thereceiver side. De-serialization may take a little more time compared toserialization (due to the fact that the receiver needs to load the classand create the object, whereas in the serialization side the object isalready present). However, advantages gained in reducing memoryrequirements on the receiver side will generally outweigh anydisadvantages caused by such time differentials, particularly where thede-serialization side has less memory compared to serialization side,such as in the case of an application server sender that is respondingto mobile device receiver. Moreover, aspects using schema (iii) do notadd any overhead in the case of an ORB serializer in Common DataRepresentation format, because in this case the reference cache uses theoffset (array location) as the handle instead of the sequence number.

The terminology used herein is for describing particular aspects onlyand is not intended to be limiting of the invention. As used herein, thesingular forms “a”, “an” and “the” are intended to include the pluralforms as well, unless the context clearly indicates otherwise. It willbe further understood that the terms “include” and “including” when usedin this specification specify the presence of stated features, integers,steps, operations, elements, and/or components, but do not preclude thepresence or addition of one or more other features, integers, steps,operations, elements, components, and/or groups thereof. Certainexamples and elements described in the present specification, includingin the claims and as illustrated in the figures, may be distinguished orotherwise identified from others by unique adjectives (e.g. a “first”element distinguished from another “second” or “third” of a plurality ofelements, a “primary” distinguished from a “secondary” one or “another”item, etc.) Such identifying adjectives are generally used to reduceconfusion or uncertainty, and are not to be construed to limit theclaims to any specific illustrated element or embodiment, or to implyany precedence, ordering or ranking of any claim elements, limitationsor process steps.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

1. A computer-implemented method for optimizing reference cachemaintenance in a serialization system, comprising executing on acomputer processor the steps of: serializing a plurality of objects intoa buffer; determining whether any of the plurality of objects arerepeated within the buffered serialized plurality of objects; encoding arepeated object with a special value tag at a location of the repeatedobject within the serialized plurality of objects, wherein the repeatedobject is determined to be repeated within the serialized plurality ofobjects; inserting a first hexadecimal number value at a start of thelocation of the repeated object within the serialized plurality ofobjects; inserting a handle of the repeated object immediately after thefirst hexadecimal number value; and sending, as reference cachemanagement instructions to a receiver, a single chunk comprising theserialized plurality of objects with the encoded repeated object, theinserted first hexadecimal number value and the inserted handle.
 2. Themethod of claim 1, further comprising: prior to sending the single chunkto the receiver processor, modifying the inserted first hexadecimalnumber value to a different, second value in response to determininganother repetitive occurrence of the repeated object.
 3. The method ofclaim 1, further comprising: inserting an extra byte of informationwithin the serialized plurality of objects before a start of a first toplevel object of the plurality of objects; initializing the insertedextra byte value to an initial value that signifies to the receiver thatthere is no repeated object within the buffered serialized plurality ofobjects; and updating the initial value of the inserted extra byte valueto a different value in response to determining that an object isrepeated within the serialized plurality of objects, wherein thedifferent value signifies to the receiver there is a repeated objectwithin the buffered serialized plurality of objects.
 4. The method ofclaim 3, further comprising: inserting secondary bytes of informationwithin the serialized plurality of objects immediately after the firstbyte of information that comprise a list of handles of objects that arerepeated in the serialized plurality of objects.
 5. The method of claim4, wherein the step of inserting the secondary bytes of informationwithin the serialized plurality of objects comprises: inserting a firstsubset of bytes that indicates a number of object repetitions; andinserting a second subset of the secondary bytes immediately after thefirst subset that comprises a list of handle values of each of therepeated objects.
 6. The method of claim 5, further comprising: deletingfrom the second subset of the secondary bytes handle values ofadditional occurrences of one of the repeated objects.
 7. The method ofclaim 5, further comprising: in response to determining that a totalnumber of object handles within the second subset of the secondary bytesmeets a threshold value, replacing the different value of the insertedextra byte value that signifies to the receiver there is a repeatedobject within the buffered serialized plurality of objects with a thirdvalue that notifies the receiver to maintain a reference cache for theserialized plurality of objects.
 8. The method of claim 1, furthercomprising: integrating computer-readable program code into a computersystem comprising a processor, a computer readable memory in circuitcommunication with the processor, and a computer readable storage mediumin circuit communication with the processor; and wherein the processorexecutes program code instructions stored on the computer-readablestorage medium via the computer readable memory and thereby performs theserializing the plurality of objects into the buffer, the determiningwhether any of the plurality of objects are repeated within the bufferedserialized plurality of objects, the encoding the repeated object, theinserting the first hexadecimal number value, the inserting the handleof the repeated object, and the sending as reference cache managementinstructions to the receiver the single chunk.
 9. The method of claim 8,wherein the computer-readable program code is provided as a service in acloud environment.
 10. A system, comprising: a processor; a computerreadable memory in circuit communication with the processor; and acomputer readable storage medium in circuit communication with theprocessor; wherein the processor executes program instructions stored onthe computer-readable storage medium via the computer readable memoryand thereby: serializes a plurality of objects into a buffer; determineswhether any of the plurality of objects are repeated within the bufferedserialized plurality of objects; encodes a repeated object with aspecial value tag at a location of the repeated object within theserialized plurality of objects, wherein the repeated object isdetermined to be repeated within the serialized plurality of objects;inserts a first hexadecimal number value at a start of the location ofthe repeated object within the serialized plurality of objects; insertsa handle of the repeated object immediately after the first hexadecimalnumber value; and sends as reference cache management instructions to areceiver a single chunk comprising the serialized plurality of objectswith the encoded repeated object, the inserted first hexadecimal numbervalue and the inserted handle.
 11. The system of claim 10, wherein theprocessor executes the program instructions stored on thecomputer-readable storage medium via the computer readable memory andthereby: prior to sending the serialized plurality of objects with theinserted object repetition data signal as the single chunk to thereceiver processor, modifies the inserted first hexadecimal number valueto a different, second value in response to determining anotherrepetitive occurrence of the repeated object.
 12. The system of claim10, wherein the processor executes the program instructions stored onthe computer-readable storage medium via the computer readable memoryand thereby: inserts an extra byte of information within the serializedplurality of objects before a start of a first top level object of theplurality of objects; initializes the inserted extra byte value to aninitial value that signifies to the receiver that there is no repeatedobject within the buffered serialized plurality of objects; and updatesthe initial value of the inserted extra byte value to a different valuein response to determining that an object is repeated within theserialized plurality of objects, wherein the different value signifiesto the receiver there is a repeated object within the bufferedserialized plurality of objects.
 13. The system of claim 12, wherein theprocessor executes the program instructions stored on thecomputer-readable storage medium via the computer readable memory andthereby: inserts secondary bytes of information within the serializedplurality of objects immediately after the first byte of informationthat comprise a list of handles of objects that are repeated in theserialized plurality of objects.
 14. The system of claim 13, wherein theprocessor executes the program instructions stored on thecomputer-readable storage medium via the computer readable memory andthereby inserts the secondary bytes of information within the serializedplurality of objects by: inserting a first subset of bytes thatindicates a number of object repetitions; and inserting a second subsetof the secondary bytes immediately after the first subset that comprisesa list of handle values of each of the repeated objects.
 15. The systemof claim 14, wherein the processor executes the program instructionsstored on the computer-readable storage medium via the computer readablememory and thereby: deletes from the second subset of the secondarybytes handle values of additional occurrences of one of the repeatedobjects.
 16. The system of claim 14, wherein the processor executes theprogram instructions stored on the computer-readable storage medium viathe computer readable memory and thereby: in response to determiningthat a total number of object handles within the second subset of thesecondary bytes meets a threshold value, replaces the different value ofthe inserted extra byte value that signifies to the receiver there is arepeated object within the buffered serialized plurality of objects witha third value that notifies the receiver to maintain a reference cachefor the serialized plurality of objects.
 17. A computer program productfor optimizing reference cache maintenance in a serialization system,the computer program product comprising: a computer readable storagemedium having computer readable program code embodied therewith, whereinthe computer readable storage medium is not a transitory signal per se,the computer readable program code comprising instructions for executionby a processor that cause the processor to: serialize a plurality ofobjects into a buffer; determine whether any of the plurality of objectsare repeated within the buffered serialized plurality of objects; encodea repeated object with a special value tag at a location of the repeatedobject within the serialized plurality of objects, wherein the repeatedobject is determined to be repeated within the serialized plurality ofobjects; insert a first hexadecimal number value at a start of thelocation of the repeated object within the serialized plurality ofobjects; insert a handle of the repeated object immediately after thefirst hexadecimal number value; and send as reference cache managementinstructions to a receiver a single chunk comprising the serializedplurality of objects with the encoded repeated object, the insertedfirst hexadecimal number value and the inserted handle.
 18. The computerprogram product of claim 17, wherein the computer readable program codeinstructions for execution by the processor further cause the processorto: prior to sending the serialized plurality of objects with theinserted object repetition data signal as the single chunk to thereceiver processor, modify the inserted first hexadecimal number valueto a different, second value in response to determining anotherrepetitive occurrence of the repeated object.
 19. The computer programproduct of claim 17, wherein the computer readable program codeinstructions for execution by the processor further cause the processorto: insert an extra byte of information within the serialized pluralityof objects before a start of a first top level object of the pluralityof objects; initialize the inserted extra byte value to an initial valuethat signifies to the receiver that there is no repeated object withinthe buffered serialized plurality of objects; and update the initialvalue of the inserted extra byte value to a different value in responseto determining that an object is repeated within the serializedplurality of objects, wherein the different value signifies to thereceiver there is a repeated object within the buffered serializedplurality of objects.
 20. The computer program product of claim 19,wherein the computer readable program code instructions for execution bythe processor further cause the processor to insert secondary bytes ofinformation within the serialized plurality of objects immediately afterthe first byte of information that comprise a list of handles of objectsthat are repeated in the serialized plurality of objects.